package com.xoa.controller.financialManage;

import com.xoa.model.financialManage.IncomeExpensePlanWithBLOBs;
import com.xoa.service.financialManage.IncomeExpensePlanService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

//计划管理
@RestController
@RequestMapping("/IncomePlan")
public class IncomeExpensePlanController {

    @Autowired
    private IncomeExpensePlanService planService;


    //查询列表
    @RequestMapping("/findIncomePlan")
    public ToJson findIncomePlan(HttpServletRequest request, IncomeExpensePlanWithBLOBs planWithBLOBs){
        return planService.findIncomePlan(request,planWithBLOBs);
    }

    //单个查询
    @RequestMapping("/findIncomePlanById")
    public ToJson findIncomePlanById(HttpServletRequest request, IncomeExpensePlanWithBLOBs planWithBLOBs){
        return planService.findIncomePlanById(request,planWithBLOBs);
    }

    //删除接口
    @RequestMapping("/deletePlanById")
    public ToJson deletePlanById(HttpServletRequest request, @RequestParam(value = "strId") String strId){
        return planService.deletePlanById(request,strId);
    }

    //编辑和新增接口
    @RequestMapping("/editOrInsertPlan")
    public ToJson editOrInsertPlan(HttpServletRequest request, IncomeExpensePlanWithBLOBs planWithBLOBs){
        return planService.editOrInsertPlan(request,planWithBLOBs);
    }

    //批量 修改状态
    @RequestMapping("/editPlanStatus")
    public ToJson editPlanStatus(HttpServletRequest request, @RequestParam("Field") String Field, @RequestParam("value") String value,@RequestParam("strId") String strId){
        return planService.editPlanStatus(request,Field,value,strId);
    }
}
